﻿Public Class Lista_Alojados
    Dim rs As ADODB.Recordset
    Dim sql As String
    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        Me.Dispose()

    End Sub

    Private Sub Lista_Alojados_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conectar()
        sql = "SELECT CLIENTE.NOMB_CLIEN, CLIENTE.PATE_CLIEN, CLIENTE.MATE_CLIEN, HABITACION.NUME_HABI FROM ((HABITACION INNER JOIN REGISTRO_HABITACION ON HABITACION.CODI_HABI = REGISTRO_HABITACION.CODI_HABI) INNER JOIN CLIENTE ON REGISTRO_HABITACION.CODI_CLIEN = CLIENTE.CODI_CLIEN)"
        rs = coneccion.Execute(sql)
        While rs.EOF <> True
            If rs.EOF = True Then
                Exit While
            End If
            Tabla_Alojados.Rows.Add(rs.Fields(0).Value, rs.Fields(1).Value, rs.Fields(2).Value, rs.Fields(3).Value)
            rs.MoveNext()
        End While
    End Sub
End Class